Next | Prev | Up | Top | Contents | Index

How to Do Stereo Rendering

This section first explains how to do stereo rendering on high-end systems, then on low-end and mid-range systems.


Performing Stereo Rendering on High-End Systems

To perform stereo rendering on high-end systems (RealityEngine, Indigo2 Maximum IMPACT, and future high-end systems), follow these steps:

  1. Perform initialization, that is, make sure the GLX extension is supported and so on.

  2. Put the monitor in stereo mode with the setmon command.

  3. Choose a visual with front left, front right, back left, and back right buffers.

  4. Perform all other setup operations illustrated in the examples in the previous two chapters: create a window, create a context, make the context current, and so on.

  5. Start the event loop.

  6. Draw the stereo image:

    glDrawBuffer(GL_BACK_LEFT);

    < draw left image >

    glDrawBuffer(GL_BACK_RIGHT);

    < draw right image >

    glXSwapBuffers(...);

For more information, see the glDrawBuffer() reference page.


Performing Stereo Rendering on Low-End and Mid-Range Systems

To perform stereo rendering on low-end and mid-range systems (including Indigo2 High IMPACT(TM)), follow these steps:

  1. Perform initialization, that is, make sure the GLX extension is supported and so on.

  2. Put the monitor in stereo mode using the setmon command.

  3. Call XSGIStereoQueryExtension() to see if the stereo extension is supported.

    1. If stereo is not supported, exit.

    2. If stereo is supported, call XSGISetStereoMode() to turn it on (options are STEREO_BOTTOM or STEREO_TOP).

  4. Choose a visual with front left, front right, back left and back right buffers by calling glXChooseVisual with both GLX_DOUBLEBUFFER and GLX_STEREO in the attribute list.

  5. Perform all other setup operations discussed in the examples in the previous two chapters: create a window, create a context, make the context current, and so on.

  6. To draw the stereo image, use code similar to this pseudo-code fragment:

    XSGISetStereoBuffer(STEREO_BUFFER_LEFT);

    < draw left image >

    XSGISetStereoBuffer(STEREO_BUFFER_RIGHT);

    < draw right image >

    glXSwapBuffers(...);


Next | Prev | Up | Top | Contents | Index